﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using skiordiecore;

namespace skiordie_gui
{
    public partial class AddParticipantForm : Form
    {
        public AddParticipantForm(Root root)
        {
            InitializeComponent();

            foreach (Participant p in root.intKeyParticipants)
            {
                // create the subitems to add to the list
                string[] myItems = new string[] { p.firstName, p.lastName, p.birthDate.ToShortDateString() };
                ListViewItem lvi = new ListViewItem(myItems);
                lvi.Name = p.id.ToString();
                // insert all the items into the listview at the last available row
                listViewAddParticipant.Items.Add(lvi);

            }
        }

        public ListView.ListViewItemCollection lvi { get; set;}
        public String name;

        private void btnOk_Click(object sender, EventArgs e)
        {

            name = listViewAddParticipant.SelectedItems[0].Name;
            this.DialogResult = DialogResult.OK;

        }

        private void AddParticipant_Shown(object sender, EventArgs e)
        {
            
            
        }
        


    }
}
